<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateInfoPageTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('info_page', function (Blueprint $table) {
            $table->unsignedInteger('info_category_id')->primary()->comment('栏目表ID');
            $table->string('title', 100)->default('')->comment('标题');
            $table->unsignedInteger('cover_image')->default('0')->comment('封面图');
            $table->string('keywords', 500)->default('')->comment('关键词');
            $table->string('description', 200)->default('')->comment('摘要');
            $table->text('content')->nullable()->comment('详细内容');
            $table->unsignedInteger('hits')->default('1')->comment('浏览量');
            $table->tinyInteger('status')->default(1)->comment('发布状态，0未发布，1已发布 ，数据字典');
            $table->unsignedInteger('created_user_id')->default('0')->comment('管理员表ID');
            $table->timestamp('created_at')->nullable()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('info_page');
    }
}
